Improve mode update mechanism. Add mode toggle button. Bug fix for add node with click