Refactor out the JS, and use grunt to build
move code out to the external javascript
Add some simple tests