Feature/flask groups frozenset

Change the groups list to a frozenset.  We usually use these as sets rather than lists (to check whether a user is in a group) and doing this by default is more efficient than having to convert everytime we do a check in the application code.