Refactors history and how the database is stored

- Alternative for https://bugzilla.mozilla.org/show_bug.cgi?id=986966 and https://bugzilla.mozilla.org/show_bug.cgi?id=865893
- Moves localStorage checks to the compatibility.js

Pros:
- Firefox will not store any history of the browsed files permanently, so no keeping of the trail

Cons:
- Firefox will not store any history of the browsed files permanently, so no restore of the current PDF position after browser is closed