Remove all the major mode tracking code.

It only caused bugs and wasn't necessary at all, Emacs will take
care of all the stuff I tried to do itself.