Implemented callback-based flag setting system and added flags to all opcodes.