Remove `basename` parameter from assertions.

This is a step towards getting the equivalent of the stuck #884 merged.

As discussed on #884, hardly anything uses the `basename` parameter and it causes something of a nasty, non-orthogonal API so we get rid of it.