Support json for objects

Suggested by @Natim
Move json tests to separate file for layout consistency
Fix JSON as abstract mapping, but support list too