Add support for AMD (require.js) and only pollute the global namespace when neither AMD nor CommonJS are in use (addresses Issue 10)
Restructure the examples