Refactored the output of prepare_data, the layout engin separated from XML...
Refactored the output of prepare_data, the layout engin separated from XML output, fixed bug with skipped levels.
There are lots of changes, may need more thorough testing. This branch fixes the bug #12 (closed) , producing the floowing diagram: