Framework for building modular document image analysis algorithms to support research and rapid application development