Added conversion and output of lines to json