New version of the Javascript

Rewrite javascript to be asynchronous and hopefully faster. Also tidies up the
output, especially for includes.
Separate module types from modules, and clear up various bits of code
Merge pull request #47 from lpw25/master

New version of the javascript and a lot of tidying up
Fix module type paths
Merge pull request #48 from lpw25/master

Fix module type paths
Fix alignment of include buttons
Fix type selection
Merge pull request #49 from lpw25/master

Fix type selection