Moved time-consuming operations from toString to setAuthorities

The toString method is called lots of times whenever the permissions
of a user is to be checked. Every toString call will create a
concatenated string of all the groups the user is part of. I have
moved this concatenation to the setAuthorities method, which will
cause it to be run on login instead of every time a user needs
permissions for anything. Big performance gains have been seen at
the low cost of having to re-log if a relevant change is made in
the users permissions.