Rework subproc.c's interface for better code sharing and more uniformity.