Rebuilt Login class. Fixes #6 #7