Refactor into Backbone framework

First pass at refactoring into the Backbone framework. Move in-page
JavaScript into external file.