Use local storage shim

This commit replaces all uses of localStorage and the firefox preferences storage with the newly created local storage shim.