Several bug fixes on the toolbar refreshing.
Bug fix: the editor toolbar buttons now light up properly.
Removed some old code.