Support json output in --format flag of docker inspect

Closes #4371