replacing hand-made database handling by pony orm
refactored registration and login using pony orm