Remove unused and not completely correct code

This stuff wasn't tested (EDIT: with the same tests as the rest of the system) and has diverged from reality, so it's time for it to go away.
We should use better names than e, a here. I can't tell what's going on easily.