Moved the BitMask class into its own file.