Diagram parser

This was supposed to be merged to the master