move accounts related code to a separate file
move the router code to /lib

The code needs to be accessible to both client and server
require username and email