Truncate big job metric values.
Wasn't needed for sqlite based testing - but based on Nicola's experience must be for some other database backend.

https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d460a6cade#comment-924461
Use Nicola's improved logic for env output parsing for env metrics plugin.
Very well laid out here https://bitbucket.org/galaxy/galaxy-central/commits/a45f6e57f3d5a4075430a6d460a6cade#comment-924461 with examples. The one modification I made was to move the logic for truncated large property values into the model layer so it applies for all plugins.
Slightly more defensive job metrics env parsing.

The env string potentially may not match exactly if there are problems reading or recording env output. Log the problem and leave the parsing loop.