Bug 1029967 - rewrite Makefile in email app in javascript

For promise usage, I would rather see the use of the `new Promise(function(resolve, reject) {})` [style of promise creation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) as that one will be known to work in the future.