Support recovery for last block corruption smaller than the expected
block_size, that is padding.

Also, overhaul code and better structure for the project.