Extracted JSON client functions into seperate package

Closes #317 
`newControllerClient`