Generalize CF encoding/decoding of datetime arrays to n-dimensions