add localstorage support
update tests, add some fixes