Better implementation of ArrayUtils::resetKeys.