Extract common functionality to xblock-utils

(Nit) It might make sense to go with function rather than module member, i.e. `get_loader()` => should give some flexibility in future and isolate individual usages.