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'm thinking what's better for experience. Having all parameters enlisted or kwargs? Some ppl would prefer to see something in the debuggers or in autocompletion.