combined commits for patch-refactor and browser changes

This PR includes the commits from patch-refactor.

@grechaw there should be no changes to Java tier from what was in the patch-refactor PR. Will you please sanity-check this? I think we're good to go but would like a second pair of eyes.