Filemeta json v11

Filestore/Filelog metadata output to JSON.

Worked on feedback given after a review from Victor. Hope all issues were addressed.
this leaks the memory alloc'ed before this