cleaned up stateChange callback
misc cleanup / reorg in router.js
cleaned up implementation of stateChange() and how the History API hooks in with it