JSON in the phone client and some server bugfixes

Also some exchange specification changes to make the phone-side simpler.
Now complies with the v3 specs found here:
https://gist.github.com/MadhATTER6/6255721