Use more Bacon in addTreeMode.js to help with state cleanup