Amd commonjs

Add support for commonjs and amd modules