Adding a #toJSON method on BitFlagFactory.