The merit-based pay system should involve calculations concerning the state of the neighborhoods the kids come from, the kids improvement from how they were doing before (both for the same group of kids and for the new groups of kids the teacher has compared to the last ones), the parents' educational and career attainments, learning disabilities, and potentially more factors.
Holding teachers accountable for performance is a good idea, but the nuances of factors involved deserve consideration.
No, merit pay in the market does not set a good model for the paying in school of teachers as a teacher is only one factor in a child's education. Many children do not have parents who participate in the education process, so placing all of that burden on the teacher is unfair.
I personally don't believe merit pay type bonuses are a good model for schools to have for pay. Teachers may end up fudging on grades in order to make it look like their students are outperforming their peers, or give easier assignments to skew results. However, teachers should definitely be rewarded if their students truly are excelling (such as on standardized tests that aren't graded by the teachers), and as the teacher gains seniority, their pay should increase.