Simplify some main tests.
Add an env var effective_roles specifying roles used in the currently executing command.