Fix storage of binary data for array and object types
serialize() returns binary data (NUL bytes) and not all platforms
handle that in CLOB fields (e.g. PostgreSQL).
This change uses base64 encoding to work around that, and transparently
reads (old) non-base64 data as well.
Fix boolean handling with base64 encoded data
Fix null handling with base64 encoded data