added JSON capabillity fo file writer and merged with TextWriter functionallity by adding 'format' key