fix out-of-order defs, improve reducep docstring, clean up some protocols