fixing bug in tojson, freeing memory too early

thanks Kyle
updating README, info on patching libjson