Changed my mind about how to start, I'm starting with a clone of the "useful" parts of pmd2mid rather than starting by doing a full rewrite