Tweak #to_json for commit/comment
Tweak #as_json instead of #to_json

So it actually works for collections.