Add CommonJS-style wrapping

Hi,

I've added functionality to provide CommonJS-style wrapping for the compiler. But I'm not sure what you're doing in the tests in order for me to add my own- do you have a guide anywhere?