Implement bit masks

Added bit masks for generating combinations.  Shaved runtime from
167.636s to 23.112s.