adapt localstorage test to app factory and nosetests

adapt the localstorage tests so that they work with the
create_app function. This means that we have to use local
imports in every test and run it in an explicit app_context,
because the sanitize function takes options from the config.
On the way, the moduel is adapted to nosetests.