Replace doctests with standard unit tests