Extracted JSON client functions into seperate package

Closes #317 
Ah I see, `dialer.Dialer` requires a `Close()` as well. Nevermind.