Added 'session_start' to all app pages.
Re-factored functions and added logout helper.
Added link for logout page.
Added logout functionality.