Add some manual infrastructure.
Remove some dead code.