Fixing bug in previous commit. Also added abstraction layer for authorization, since I might get away from group-based.