Factor out a method to fork a subprocess and handle messages from the child.

Reduce code duplication by factoring out a common function.  This also
separates out the "promisification" of `child_process.fork` from the
real work the functions are doing.

This new `fork` function is a candidate to move to a shared
`mw-ocg-common` package in the future.

Change-Id: Icc7e9a57c2b9e444d1d1dd4cd2d664dafe24ef85
Write output files in subdirectories.

The output directory was growing to thousands of entries and signficantly
slowing down the health check.  Create subdirectories based on the first
few characters of the job id, and create/touch the subdirectories to
ensure that their cached sizes remain accurate.

Use the `force` parameter to the gc's `cleanDir` function to ensure
that we recurse into the top-level subdirectory.

Change-Id: I61451d51dcbfee959dfb066b663fec7a185df1a3
Unify configuration file parsing.

Commit da78e552232efe0078452b0f876b926332f49c84 changed the way that
`mw-ocg-service.js` resolved its configuration file (including fixing
a typo where `process.cwd` was used instead of `process.cwd()`), but
these fixes weren't applied to the helpers in `scripts`.

A future patch should probably factor out `lib/config.js` (or some such)
to unify all the configuration file parsing in one place.

Change-Id: I3e58ca24f45cc99994043543ef9ce4d999c0e25f
Redis key expiration lifetimes should be in seconds, not milliseconds.

The configuration file specifies that all lifetimes are in seconds,
but the redis expiration code was treating them as milliseconds instead.
This bug wasn't noticable previously because the bug fixed in
7e4791f6eb15dd5e8f5dd1ff198c678fa9ce0039 was preventing anything from
being garbage collected anyway.

Change-Id: Ifb9680c2a7e18098f19ab7c8e55f13b3da3f54e4
Ensure postmortem moves complete before cleanup.

This also fixes a typo (in the renderTempDir postmortem) which was causing
the creation of directories named `<postmortem>/undefined`.

Change-Id: I651c89ec77b4abd749926d73f215140cd74e732a