Added JSON features

Can now also output in JSON