Partial fix for browser testing issue.
Restructure and small test cleanups.