Add a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`.