Implement MDT.

I also spent around 15 minutes debugging my VM, only to find it was a bug in
the test code. >_<