Separate JavaScript core files from demo files

* demo-specific code is in demo.js
* main.js is pretty bare, save a single binding
* demo.js is included in grunt concat (can be removed)