A modular software framework for the design and implementation of ptychography algorithms