test/Doctests.hs: remove code for older cabals.
test/Doctests.hs: fix include paths with newer cabal.
test/Doctests.hs: use explicit imports.
test/Doctests.hs: export only "main", explicitly.
Add a doctest test suite. Add docs and rc file example for --exclude-mx. Update docs for some functions. Split a few local functions into global ones for testing. Add doctests for existing global functions.