Added signin functionality and tests