Filemeta json v10

This is my work with implementing filestore and filelog metadataoutput to JSON.. This PR version: Fixed commit mesages and structure of theese. Merged some commits together after feedback from Victor.
Also, I wonder why we need a new buffer per call? Normally we use a buffer per thread that we reuse.