Moved command mode to modes package; removed dead code.