Improved scripts, added default page

Used jslint... to an extent. It is a bit OTT. :laughing:
Renamed header.js to createDefaults and renamed various functions for
clarity.