Fix build and test issues exposed by newly-split libcrunch.
Widen the public API a bit. Move some useful functions from libcrunch.