Unify elgg_require_js and elgg_load_js

Not well tested yet. Just need feedback.

Refs #6496.