Fixes gh-53. Use a custom matrix equality function rather than jQuery trickery.