Added simple JSON encoding. Also added a logger