Add BitFlags template

BitFlags is a typecons template for storing OR combinaton of enum
values in a type safe fashion.
Merge pull request #2058 from lultimouomo/flags

Add Flags template