Flags commands + function

Adds a SetFlags function as well as CharSetFlags and CharGetFlags
commands.