Ported some of the build process to Grunt, added comments, added hacks for Emscripten FS support.

Grunt can't easily run external scripts as new processes, so I might need to hack something together for that.

The hack I added: The Emscripten FS uses the topmost bits of the 'mode' returned from 'stat' to determine what type of file something is. We need to automatically ensure that these are set whenever the stat's mode is modified.
Some README and package.json changes.