Unit tests, browser plugin cleanups

Add some unit tests. Clean up the browser plugin by converting the inline HTML to heredocs.