Gracefully close worker on term.

This change (attempts to) add a signal handler to the worker allowing it
to gracefully shutdown on a TERM signal. This means that it will finish
the tasks that it has accepted but not request any more work.
Make S3Target respect format
Allows specification of priority for hadoop jobs
Fixes a bug in graph creation for unknown dependencies
Fix scheduling tasks with many deps/params.
Merge pull request #409 from campanja/fix-large-rpc-requests

Fix scheduling tasks with many deps/params.
Merge pull request #399 from danielhfrank/graceful-shutdown

Gracefully close worker on term.
Merge pull request #401 from tommyengstrom/S3Target-format-fix

Make S3Target respect format
Merge pull request #406 from Houzz/mr_priority

Allows specification of priority for hadoop jobs
Merge pull request #408 from Houzz/fix_unknown_task_bug

Fixes a bug in graph creation for unknown dependencies
Revert "Gracefully close worker on term."
Merge pull request #414 from spotify/revert-399-graceful-shutdown

Revert "Gracefully close worker on term."