Simplify code for getting field flags

Let's define array of flag names, so that we don't have to duplicate the
code for each flag.

Signed-off-by: Michal Čihař <michal@cihar.com>