remove an unused old header
DRY up more algorithm code, fix unnecessary re-replication of the last block of rows in the table in the matching case and add spec coverage
small optimisation: use memcmp instead of a temporary string object to compare hashes received with those calculated