Shrink internal API footprint, part 1.

#590