Add onGain/LoseExperience event, and minor fixes