To prepare a user-defined type, we need to look up its name in the keyspace.
While we get the keyspace name as an argument to prepare(), it is useless
without the database instance.
Fix the problem by passing a database reference along with the keyspace.
This precolates through the class structure, so most cql3 raw types end up
receiving this treatment.
Origin gets along without it by using a singleton. We can't do this due
to sharding (we could use a thread-local instance, but that's ugly too).
Hopefully the transition to a visitor will clean this up.
cql3_type is a wrapper around data_type, so there's no need for a class
hierarchy -- anything that depends on the actual type can be forwarded
to abstract_type_impl.
We can now use this as a value type (dropping shared_ptr<cql3_type>), but
that is left for later.