Added login functionality, updated tests