New handler for retrieving properties when object is serialized

This handler is used in var.c for getting properties from object. If not available, standard get_properties is used. It works similar way as get_debug_info.