Refactored some more, added undotree binding