AMD detection

Exactly as in https://github.com/ded/bonzo/pull/108.

Would be really appreciated. If there are minification issues with the 'define.amd' use in the ender build, these shouldn't affect the ender environment anyway, but it could be worth checking. Understand if this is reason not to commit though.