Lots of changes; added JSON-ifier