Implemented better user tokens

They are now really unique, while before there could have been
collisions. Also fixed a pretty serious registration bug.