Organized db logic, basic login/logout