Check out JT's
Text::Flowchart to save you some work generating your text rendering.
If you want all of these things to be interchangable and bi-directional, you're going to need to store your metadata and regenerate your diagrams. That's the only way to keep them consistent.
HTH