Add support for exports when using AMD

Currently, AMD "exports" either add properties to the `window` object (in the browser environment) or rely on `module.exports` (for Node). Neither of these is the correct way to export from an AMD module.

This pull request fixes that by automatically choosing the most appropriate of the two correct ways to export from AMD:

* `return`ing a variable when its name is provided as a string to the "exports" config value.
* Using [AMD's special "exports" dependency](https://github.com/amdjs/amdjs-api/wiki/AMD#using-require-and-exports) when multiple variables are requested in an array.

Two new tests have also been written to validate the output from this functionality.