Add mutli-deserialization support

This PR adds support for multiple-deserialization and therefor fixes some
things in the JSON deserializer.

Related to #510 and #493.