Updated for integration of browser code into couchapp.