Move emitter into lib, add qrscan function