Add AMD support for the browser

The title pretty much says it all. This benefits all the people of the community using AMD while preserving the use of the global variable if no AMD loader is found.