Refactor init() method

Also includes various bug fixes relating to the MutationObserver rewrite.