Tidied up and tweaked controller
Introduced some genera jinja2 templates, to provide a JavaScript include