Output format improvements

- Changed output format. Got rid of JSON'ed JSON;
- Speed and memory improvements because of more strict specialisation;