Cache entropy matrix

This is just a merge of https://github.com/priorknowledge/loom/pull/76 + https://github.com/priorknowledge/loom/pull/77