Began implementing history.js API. Currently quite buggy