Fixed problem with saving new models.

The previous detection was a bit iffy (totally non-functional), and
would just fail terribly. It works now, at the cost of a couple of new
methods in the Model interface.