An appraisal based model of emotion implemented in javascript