Move CustomEventGoal out of popup.js
Create goals through REST API on image popup too