Complete rewrite of `msdcon`

`msdcon` rewritten using user-defined types and a more object-oriented
approach.