Moved bit flag functions into their own unit.

Extracted various bit flag helper functions from Formatter.c and moved
them to bitFlags.h/.c.  Renamed hasBitFlag() to isBitFlagSet().