Fix broken doctests

This patch fixes the way doctests are loaded by test.py so all doctests are included.

Also included in this patch some minor doctest fixes.
This should also include `generate_external_command.py`, the tests are failing because BeautifulSoup isn't installed. Maybe create a list constant of excludes?