Moving from using $cookies to using $localStorage