Update tests to work in both the browser and command line