Moved mode-switching logic from designer.js into modes.js