Assemble contiguous blocks from unique chunks
Remove chunk hashes from the map as we go.
Use pointer <-> uint conversions to resolve compiler warnings.
Minor tidies and free the blocks at the end