Added basic serialization of Option types

Note that this removes all null-valued fields when serializing a case
class, even if they are unrelated to option types.