Datamodel to json

I finished the implementation of the converter and added some test functions with the last commit. The code can be reviewed now.