Stores last used settings in local storage and restores them on page load