Remove unused and not completely correct code

This stuff wasn't tested and has diverged from reality, so it's time for it to go away.