Added AMD support with global namespace pollution.

Let's give this another try:

I've added AMD support with pollution of the global namespace, to avoid issues with legacy code.

Any comments?