Add the Model library
merging with upstream master and origin temp0
fix typo in cmakelists
fixed pointers which were using 0 instead of NULL and syntax in resource.h
fix end line typo
Merge pull request #3998 from samcake/temp1

Adding the model library
merging with upstream master after adding the add model lib PR