[Refactor] In-progress: strip down mod_main.js to doing only "essential" work

- Moved code to ensure $topLevelContainer is in DOM after a dom-change to mod_mutationObserver