Update `serialize` method to not inlcuded empty compartments

Here's an updated PR to allow for embedded documents to not be required. This also ensures that empty compartments are not included in a serialized document.
And upon further investigation, a clean/fresh tox environment tests pass just fine, but running tox again ends up with the errors as shown by Travis.