Fixed serialization where non-required properties with default values would sometimes not get serialized
Other changes:
  - Cleaned up more variable names
  - Cleaned up a few comments