CommonJS compatibility

Hey thanks for the fantastic plugin!

This is a simple change which adds compatibility with CommonJS alongside AMD..

Steve