Use the md5 of the content instead of the file timestamp for memoization

This fixes the problem where .ref files don't update on refresh.

The problem is that after stripping off the .ref, the file referenced by `filenamedoesn't e