Changed integers in bitwise arithmetic to hex

Changed most (all?) of the integer constants used in bitwise ANDs and
ORs to their hex representation to make them more transparent. Also
started making any progress at all grokking the internals of this mod :D