Dealing with rounding errors in function invMod2.

The performance of my encoding functions were being degraded due to rounding errors in this inverse function. I was seeing things like 2.0 % 2 = 2. What is that about? I tried doing some casting to ints, using floor, etc. but that did not work. So I added some steps to manually check the results from mod 2 operations before declaring the inverse found or not found.

Also adding better comments to regularLDPCcodeConstructor function.