Use correct HABTM config, use complete user data & fix group rules

* The groups a user belongs to are now stored correctly as HABTM
  inside the record itself.

* The complete user record data is now stored in the user's session
  Previously only the username was stored

* Groups are now added to the new user data, and they can be used
  in rules