Added unit tests for modelprop library

And fixed some bugs that it revealed