Additional summary speedup, requires modifying chains.hpp

This version is possibly incompatible with Cython 0.19