move allow_undo, allow_end_turn impl's to lua