Fixed implicit return in AMD code

I accidentally the factory's return value and CoffeeScript unhelpfully returns the last expression in the function, so the AMD definition gets mangled (and the browser global too).

I fixed that by assigning the `exports` object to the browser global explicitly and returning that explicitly from the AMD module definition.

I haven't changed the factory function because a trailing `return exports` would be too easy to miss.

Sorry about the mess.