Added base64 encoding to JSON objects (as some Queue clients only support base64). By default is set to false.
Fixed base64 decoding in some cases.