refactored moon_flag_new_*
unsigned API is deprecated in Lua 5.3