switch VariableSerializer to o_toArray instead of o_getArray

Because some classes have custom implementations of ToArray,
we must let o_toArray decide whether or not we should call
o_getArray because the latter only deals with dynamic properties.