Started using JObject instead of string building.

Found a better and faster way of making the JSON objects need to send to
the bridge.

And add some comments to the code.