Add subclassing test case based on IPython's usage of mistune

This cannibalises IPython's subclasses of mistune objects as a test case. This should ensure that the API which we're using doesn't accidentally break again without a deprecation period. Even if breaking changes are necessary, this may at least serve to give us advance warning of them.

Ping @Carreau.