Added support for registering cleanup commands to be performed just
before removal of models; for instance inheritance relations.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>