Fixes for devicestorage and webgl

This is where I got with getting mochitests running with the emulator. Just a work in progress, I'm afraid.