Refactored log level storage to window.localStorage (or cookies)

By relying on try-catch-blocks (which are needed anyway for safety), we can omit most of the code checking for availability of `window.localStorage` and similar.