Add Agent#to_json.
Refactor to use hashes for internal state storage.

Makes outputing json much easier.
Add a utility module for mixing in common functions.
Use the utility module to parse time values.
Use the utility module to parse URIs.
Use the utility module to clean JSON structures.
Fixup the to_json methods so that JSON#generate can use them.

This was being done incorrectly before. Now each class can serialize itself when
called upon to do so by the various JSON generator methods.
Minor fix to the Util module documentation.
Add a Util test case and test the parse_time method.
Add tests for the Util#parse_uri method.
Add tests for the Util#clean_json method.