Divide g.js into modules.

g.js is way too big for its own good. This PR divides up the file into smaller, more manageable modules.

It uses (or will use) [Browserify](http://browserify.org/) to compile the modules into a bundle to be used standalone.