Bug 1029967 - rewrite Makefile in email app in javascript

This will result in another scan of the build directory and a duplicate file content read. Instead, perhaps allow a callback to sharedUtils.writeSharedJson, that gets passed the file name and contents. So for email, maybe it looks like this:

```javascript
var digests = [];
function onFileRead(file, contents) {
  digests.push(sharedUtils.getDigest(contents));
}

exports.execute = function(options) {
  var stageAppDir = utils.getFile(options.STAGE_APP_DIR);
  utils.ensureFolderExists(stageAppDir);
  var r = require('r-wrapper').get(options.GAIA_DIR);
  Promise.all([optimize(options, r), sharedUtils.writeSharedJson(options, r, onFileRead)])
    .then(function(result) {
      var options = result[0];
      sharedUtils.writeCacheValue(options, digests);
      removeLoader(options);
      removeFiles(options);
    });
};
```

And with that change, `writeCacheValue` does not do a directory walk, but just converts the digests array into a string value and modifies the html_cache_restore.js file.

I would also put the `writeCacheValue` just in the email Makefile, since it is the only one that sets up a cache like this. So perhaps that means getDigest should be in here too. If others end up needing it, it could move into the shared area at a later date. But if we are lucky, we can just remove the cookie cache from email some time in the future, and we can just delete that code, which will just be contained to the email app's directory.