Support for loading as an AMD module

Allow the plugin to be loaded as an AMD module.  For more details, see:
http://requirejs.org/docs/whyamd.html

As a side effect, this prevents things from being instantiated multiple times if the script is included more than once on the page.