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).
I fixed export_roles_permissions_get_role_permissions(...) so it doesn't return extra spaces anymore.