Improve HTML style

Looking at unorganized rendered HTML code, unnecessary conditions and duplicated code in templates motivated me to do some major refactoring.

No functionality was removed, only code in templates reorganized and reindented, new blocks for extending parts of templates were added (see ``base.html``), unnecessary conditions removed, and some templates changed to extend others to reduce code duplication (e.g. index-like pages should look the same).

New settings (older names are still supported):

```
FAVICON = 'static/img/favicon.ico'
TOUCHICON = 'static/img/apple-touch-icon.png'
SITELOGO = 'static/img/logo.jpg'
SITELOGO_WIDTH = 100
SITELOGO_HEIGHT = 100
```