switched from jquery deferreds to A+ promises
switched over to promise-es6; fixed some scope problems