converting localStorage into requirejs module