MDL-17081 add role export/import

This includes improved role creation, allowed roles are editable and other improvements.