Scriptapi code cleanup, add ModApiUtil shared between game and mainmenu