Convert JS to AMD for several plugins

Edit: This is no longer a breaking change but a feature + deprecation. Hopefully this will at least push people toward AMD by giving them more examples and deprecation warnings, even though we still don't get to use the libraries ourselves... :(

- [ ] Undelete js/discussion/discussion.js
This should be `require`, not `elgg`. Scrutinize caught this one. Pretty good catch!