add _toJson function in utils/__init__.py
 - rename _toJson => toJson
 - add documetation in utils.rst
Fix: better documentation for toJson (Thanks to tardyp)
Merge delanne/buildbot:trac2659 (PR #1243)

+autopep8