Move GetOrAdd to an extension method.