Fixes for JSON reader and writer

JSONReader: read end of objects in iterations
JSONWriter: only write iteration if it contains data
Merge pull request #4 from voltprime/master

Fixes for JSON Reader and Writer