CML improvements

Rewrote CML parsing and generating to play better with compound_graphs, and also to use lxml instead of xml