Merging front end app

Ok, this is a painful pull request, I know. There's plenty more I want to do but its important to get this in so that things can instantly become more manageable after.

'static' and 'tests' will move/be renamed so the top structure is more understandable soon.

The end result of this changeset is that the generated markup ships with it a benign but 'running' JS app.