Implementing the major mode.