Calculates and returns the penalty score based on state of this QR Code's current modules. This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. @TODO: This can be optimized by working with the bytes instead of bits.