Revert "Some tidy up. Externalise more JS. Used better names for some HTML ids."
This reverts commit 471404b5a093f7a1e31fa00b6200ca3e9ef6a3d8.

Can't push the ohter part of the changes to mercurial from China so I'm
temporarily reverting the last commit to avoid unstable code base and
will recommit later.