WIP: Speedup login part2
See https://gitlab.com/gitlab-org/gitlab-ce/issues/2341#note_2147021
This is completly untested, the necessary migration is missing and I expect it to fail miserable at this point, but I wanted to get some feedback if i'm going into the right direction with this.
cc @jacobvosmaer what do you think?