Add an interface for type objects to control Ruby => SQL

Adds the ability to save custom types, which type cast to non-primitive
ruby objects.