Move flag-related code into new pkg package

deprecated string list?