Fixes/Preparation for json deserializer

This is another rip from #260 which fixes a bunch of things. #260 itself needs
to be rebased on this and could then be merged, so please review carefully.
This changeset may be a result of bad usage.

I think you can omit this changeset now, since you don't even have anything to do with a command anymore (you sould use `ws_statement_init()` anyways).