Split out demo-specific code from lib/browser.js