[sqltypes] Add support to serialize and deserialize them

Also got rid of half complete MarshalJSON implementation.
This 4 lines seems repetitive.  The only difference is the field type.  maybe implement all of these inside writeTo as well