Decode JSON to avoid ReadFile

`docker ps -a` and `docker images` were allocating a lot of memory because of `ioutil.ReadFile`. Running those two commands 10000 times would cause the allocation of around 30-50 gigabytes because of ReadFile.

This PR fixes some code paths for images, containers and volumes to use JSON decoding instead.