added background page for local data caching plus a bunch of bugfixes