Moved emitter to frb.js to reduce code in index.html