Reimplemented the small cache

A small cache speeds up the many smaller merges