Add some code for DAGman metrics #3532

Note that the separator between key-value pairs in JSON is a comma, not
a newline; whitespace is only for readability.

If we are going to write a string, we should try to encode it so that it
goes through a JSON decoder properly.
Add the dagman_metrics_reporter #3532

This franks, but I need to find out from Kent and the design document
which environment variables will be used and also what is supposed to
happen with the DAGMan status