model.js: Model.fromObject: fix check for prop type is function

And only set the prop if value !== null