Roles vocabulary: tests / readability

- Added tests for the roles vocabulary
- Refactored code to be more readable