Fix bug with counting key sizes, move HEADER_LENGTH outside responsibility of disk size of basement, simplify dmt