Added JSON packet handling. It still needs work to make the packet calls transparent.
Stabilty improvements.