Fix gamestate:init() bug, and error on undefined callbacks
Fix class commons compatibility