Update barcodescanner.js to allow provision of `this` scope for callback functions.