Bug 1029967 - rewrite Makefile in email app in javascript

Just matching the comment above, this can become:

```javascript
function writeSharedJson(options, r, onFileRead) {
```