more robust equality checking for Model (closes #59)