encapsulate loacal storage and window calls, so we can run packaged as non sandbox