Implement CRC-32 error-detecting code

Implemented also reverse_int which reverses the bit order
of an integer. MSB becomes LSB, MSB-1 becomes LSB+1 ....