Separate files to better organize code

* utils.js holds utility methods
* main.js holds a function that can be run from 'd8'