Extract out serialization tests and begin to formalize the api