Ignore generated and state files
Convert mode definitions to `define-minor-mode` from plain `defun`.