unit tests for Model, along with some minor API tweaks and bug fixes