Refactored auth code to be a service, refactored index.html so elements only display depending on whether user is logged in