Add functionality to prep merge with master

This makes the add.js stuff, based off of MutationObserver, behave more
like master's branch. Functionality should be identical except JS code
injection is more robust for this application.