Refactored templates. Fixes #4

Removing the surrounding `<script>…</script>` is a very good change.
Should we rename `headscript` to something else, like `headextra` or something? Templates extending base can now append anything (scripts, stylesheets) to the `<head>`.

LGTM