store logs in localStorage

And a few cosmetic changes.