Added PermitDB.GetAllPermits()

In addition, cleaned up some racy behaviour in RoleGroupCache
and dummyPermitDB.

Added a tiny test for the Role DB.