Made Model.__eq__ consider proxy models equivalent

This pull request fixes tickets #11892, #16458, #14492 and #20777.