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.
I hear your point, I was clearly short sighted. And I apologize about the tests. I was running with plain old pytest and forgetting to run with tox before pushing.