Also, reorder word fields so that the flag field is more easily accessible.
Common code used by more than one app, but not by the kernel.