Cleaned some code. Finished login implementation.