Allow persistence of namespaced classes

Fixes #27. Thanks @jgroeneveld!