fixing array.length only when array of objects

cc @ianstormtaylor for review
mixpanel handles arrays of numbers and strings well, but not arrays of objects or arrays of arrays.