Close streams properly.
Guava is non-null by default.
Use JSON as the metadata format.