Fixed the AMD boilerplate so that it works with the RequireJS optimizer.

I kept getting the 'Mismatched Anonymous define() module" error (see http://requirejs.org/docs/errors.html#mismatch) when trying to optimize the lib using RequireJS so I modified the AMD boilerplate code to fix this - basically, RequireJS needs to see code that looks like this:

```
define([...], function() {...});
```