Some refactorings. Default sort order for styles and history. Nicer options page.