Move some more code around to make it easier to override from rave-build.
Fix typo that would overwrite context.env if it already exists.
Remove unused function.
Inject hooks into configureLoader.