make it requireable in node

hiya - I use node and npm to manage javascript dependencies and wanted to build stuff with this for http://voxeljs.com but it assumed it was always going to be running in a browser so this patch makes it commonjs compatible.