Added Promise.catch
Fixed Promise so it rejects on uncaught exception
Catch possible rejection on ViewHistory.setMultiple
Merge pull request #4826 from dferer/localstorage-exceptions

Wrapped localstorage.setItem in try block to avoid uncaught exceptions.