Function to compare a model and an object. If object has all nested properties of model, it returns true.