rewrote localStorage to not use the window object (IE doesnt like it)