Test cases and bug fixes, Also constructor for PsSocket that takes JSONObject.

Signed-off-by: bregell <johan_bregell@hotmail.com>
Merge branch 'devAPI' into API
fixed merge conflicts
Merge remote-tracking branch 'origin/API' into develop