Add some more malformed DOI test cases.
Refactor DOI cleanup code to fix more problems.