Fixes #1239
Created by: davemevans
This allows stream types other than video and audio to have settings saved in and retrieved from local storage.
I've added a method to translate the old keys to new ones, but it might be that we chose to say that over the 2.0 -> 2.1 version transition the history is lost, in which case translateLegacyKeys
and associated stuff could be removed.
Added try {} catch
around instances of localStorage.setItem
since this can throw if quota is exceeded.
Also added a test for availability of window
to simplify testing of RepresentationController which indirectly depends on DOMStorage.