serialize to objects that can be stored as json

fixes #68

@dennisreimann