Removed old viewmode and state legacy code from the browser.js
Removed old state code
Fixed failing tests after the unused code removal