Use JSON API

**WIP - NOT READY FOR REVIEW/MERGE**

Closes site5/solusvm#55