Begin to add some tests around the basic api matching and rewriting.

This also fixes some other tests broken by the introduction of the api matching
stuff due to the config override options getting overwritten (too many
overrides!).