JSON handling improved

The generated Visual object is now valid JSON (it can be saved in JSON
repositories). The jsonify() function has been improved.