Fix load timing by using requirejs to sequence resource loading

Fixes #3 

NB I also fixed a couple of other small annoyances.