added fold-into-vec
moved functions from mmi
functions for cached computation
io functions
rows-and-cols structure (taken from mmi project)