Revert "merge model.cc from jz"

This reverts commit eeba6ff68fcc80d2fa08d4dcd83a6841f7f45de8.
Revert "Revert "Merge branch 'master' of https://github.com/paulstaab/scrm""

This reverts commit 02ca245f2529c889dfdb50f82b128ee1faf32540.