use JSON.stringify instead of constructing JSON data manually
typeof(somethhing) always evaluates to true
Merge pull request #3 from nilclass/master

JSON generation and possible bug in protocol.functions.ping