Refactor. refs #16

 * Renamed serialize and deserialize Model methods to encode and decode.
 * Extracted serialization/deserialization logic to fields and encoders/decoders.