Remove unused functions and macros
It's time again to scrub some cruft. I've got a patch in branch "unused_stuff" in my public repo that deletes a bunch of functions and macros which we don't use, and in some cases deletes their unit tests too.
This doesn't delete every unused function or macro; I left a few which in my judgment seemed likely to get used some time in the not-too-distant future. Also I probably missed some.