Flags are now a reusable constructor function. Closes #198