Added code + tests for the object-to-json direction.