rename flat => unnest; support array-like objects (e.g. arguments) when flattening