add notes about how to read the code
simplify setting type for roles
DRY up the conversion of role names to module names
combine module evaluation when defining roles
remove unnecessary local variable