Added JSON Support via writeJSON method