UNSTABLE: restructuring app code.
Forgot to add app.js to previous commit.
Minor cleanup. Putting this branch to bed until more organisation is actually needed.
UNSTABLE: Something has broken in latest revisions, working to regain stability.