Changing login to use KO models
Making db and login work correctly.