added lightweight JSON encoder/decoder