Fixed onGround calls

onGround needs objectIndex, but wasn't being used that way. Various
fixes to StateExists. First onCollision debug code done and working!
Most of the basic functionality is in now, can add more behaviours and
test :D