Add support for sparsity normalization

These changes allow a set sparsity to be declared in the constructor by setting the optional 'onbits' fields.  The desired sparsity is achieved by activating or deactivating random bits in the output until the target sparsity is achieved.  The random number generator is seeded with the hash of the input bitmap to ensure consistent results with the same input.