Move flag-related code into new pkg package

no, but `t` doesn't come after `w` either