Code review

Code review + one fix in the export_roles_permissions_grant_permissions(...) function.
We still need to make sure that the exported code creates missing roles if any (see TODO in the code).
To me, it's the responsibility of export_roles_permissions_get_role_permissions(...) to make sure that returned permissions are clean. So yes :)