Isolate schema serializaton code

patch by Aleksey Yeschenko; reviewed by Tyler Hobbs for CASSANDRA-8261