modes: clean up debugging
Add mode tracking