Redefine match

How does this look? If the docstring and the tests reflect our consensus, I'll take a stab at the docs.

P.S. There's a stray commit in here. Not sure why 88716e4 got lumped in....