The big in-browser tests classes clean-up

Removed lots of unneeded code and simplified some of the remaining.
Merge pull request #2667 from pozdnyakov/tests_cleanup

The big in-browser tests classes clean-up