Translate Model class to C++

Hopefully it fully works now.

I tried to clean up the commits a bit, merging most of the little commits into the bigger ones.

I haven't handled the new cut feature yet. I'm not sure what to do with it, because it creates new Model::Objects without actually adding them to the model, and the new Model interface doesn't currently support that. Should I add that, then?