Add doc strings to a bunch of functions, fix broken composition.