Added support for logout and user info

Also tweaked UI and improved backend structure.