Improve operational affordances for scrypt max-pending limit

This simultaneously fixes #813, #814 and #816 since they are all pretty closely related.

The first commit does all the groundwork required to enable this, by injecting `log` and `config` into the `scrypt` module as dependencies.  The subsequent three commits address each of the above issues in turn.

@dannycoates r?  In particular, does the use of `setInterval` and `unref` at this level seem OK, or should we try to factor it out to live at a higher level?