Login and registration implementation and fixes

Basically what the tile says.