change Array implementation from preprocessors to templates