Write to file

Added writeJson function, can take rapidjson document and write it to
file in "pretty" format