Move mappers/loaders to their own file and fix a couple bugs

* fix Directives sometimes being instantiated as 'Directive' model (not one of the concrete subclasses)
* fixes Role edit modal and adds missing mapping types