The concept of a moduli space goes back to Riemann's count of $3g-3$ (or $3p-3$, in older notation) coordinates to describe Riemann surfaces of genus $g$ when $g > 1$. See the bottom of p. 33 here, where Riemann introduces the term Moduln and writes multiple times on later pages about Anzahl der Moduln (number of moduli/parameters/coordinates). This was in 1857.
The 19th century gave rise to other similar-sounding terms: modular functions, modular forms, and the modular group $\text{SL}_2(\mathbf Z)$. As far as I am aware, these terms were introduced in work of people like Dedekind, Fricke, and Klein in the 1870s-1890s, and is related to Dedekind's creation of the term Modul for a lattice (in Euclidean space). Lattices in $\mathbf C$, after suitable scaling normalization to the form $\mathbf Z + \mathbf Z\tau$, are closely related to $\text{SL}_2(\mathbf Z)$, and modular functions and modular forms are related to the action of this group on the upper half-plane (and modular forms can be thought of as certain homogeneous functions on the space of lattices).
My question: is there any reason (through inspiration perhaps, if not for precise technical reasons) to expect Dedekind's term was inspired specifically by Riemann's term?
This question is an attempt to get some clarification on my answer to the MathOverflow question here.