jsonlog: Implementation of module generating logs in JSON format

The basics are here and in place, taking necessary routines from elog.c.
More fields and a better tracking of useless things taht should not be
tracked will be added soon.