Refactor the server once again, move app creation to its own file
Add login and logout, default user/pass is admin:admin