Move the require config into footer so it has a chance to be effective
on the initial load.
Adopt new version of history.js

Issues #219 and #187