Begin work for validating parameter input to roles.
Large refactoring.