Use define-derived-mode. Fixes #40.

Unfamiliar with define-derived-mode so this needs more eyeballs/testing before I'm willing to merge to master.