feature(embed): be able to require elgg.embed js from javascript

Registered js as shimed AMD module.
fix(embed): embed wasn't working in activity page

Refactored the library loading in order to be able to use lightbox and
jquery.form in an already loaded page, when an input/longtext is loaded
via ajax.

Fixes #6422