Inclusion of code for "jet toolbox"

Consolidation and addition of code for the "jet toolbox." @rappoccio also found and fixed a couple bugs along the way.

This PR is a replacement for #2801, which had merging issues.