json encoder improvement, when magic function __json__ found in object, use it instead of __dict__