I left it unindented to make the diff readable.
added compatibility with AMD
I really don't like AMD. Not merging this because AMD needs to go away.
you can convert AMD to node.js require with this https://github.com/thlorenz/browserify-ftw/
so, they will also be node.js compatible.
I support you in your dislike of AMD. I wrote a module loader and briefly considered making it AMD compatible until I realized how much I dislike the AMD spec (and the way require.js does things in general). What's your beef?