Working on background hashing

Needs review, coded whilst drunk.