Header & footer templates

Reduce the duplication between the two templates a little. Keep all of
the generic header & footer stuff (i.e. javascript includes, css
includes, ...) in separate files.