Allow serialization of non-compound graphs

Fixes #10