Fix timedeltas to work with to_json
Clean up style a bit
Merge pull request #9028 from cpcloud/timedelta-json

Implement timedeltas for to_json