The Origin(s) of Modular and Moduli In mathematics and in physics, people use the terms "modular..." and "moduli space" very often. I was puzzled by the etymology, the origins and the similarity/equivalence/differences for these usages/concepts behind for some time.
Could I seek for expert's explanations on the contrast/comparison of the "modular..." and "moduli space" in the following contexts:


*

*"Modular" in the modular tensor category. (Also the "pre-modular" category.)

*"Modular" in the modular form.

*"Modular" in the topological modular form (tmf).

*"Modular" in the modular invariance (e.g. in Conformal Field Theory).

*"Moduli space" in algebraic geometry

*"Moduli space" in Non-supersymetric Quantum Field Theories or gauge theories 

*"Moduli space" in Supersymetric gauge theories 

*"Module" in the "mod" or modular arithmetic.

*"Modular" in modular representation theory of (finite) groups/algebraic groups. [As André Henriques suggested]

*"Module": $G$-module in the group (co)homology and topological $G$-module for the topological group. [Likely related to 9.]

*"Modulus" of convergence and "Modulus" of continuity in analysis. 
Thank you in advance for solving/illuminating this rather puzzling issue.
 A: I was similarly curious when writing the introduction of my PhD thesis,
since the context was moduli spaces of Abelian differentials.
I felt the need to dig a bit and include a discussion there.
Here is an English translation of what I wrote then. The original is
here
(see page 9 of the introduction).

1. Moduli spaces
The term "moduli space" is often preferred to "parameter space" in contexts
  where one is interested in describing geometric objects up to a certain
  equivalence.
For instance, we consider the modulus of a cylinder (ratio of its height to
  its circumference) when we are interested in its shape without caring about
  its size. The moduli space of cylinders is the set of positive reals.
A more instructive example is the moduli space of tori.
1.1. Tori.
Here again, we seek to describe the shape of a torus (of real dimension 2,
  endowed with a complex structure) without taking its size into account.
A torus can be defined as a quotient $\mathbb{C}/\Lambda$ where $\Lambda$
  is a lattice in $\mathbf{C}$. Consider tori equivalent when they correspond
  to lattices obtained from each other by rotation and dilatation.
  Given a torus, we can then consider it as  a quotient $\mathbb{C}/\Lambda$
  where $\Lambda$ is a lattice in $\mathbb{C}$ with basis $(1, \tau)$. Two
  parameters $\tau$ and $\tau'$ define equivalent tori if their difference
  is an integer, or if they are opposite or inverse of each other.
  We can therefore assume that $\lvert \operatorname{Re} \tau \rvert < 1/2$,
  $\operatorname{Im} \tau > 0$, and $\lvert \tau \rvert > 1$. This draws a
  domain in the upper half-plane, located between the vertical lines at
  x-coordinate $-1/2$ and $1/2$, and outside the circle of radius $1$
  centered at the origin. Some points in this domain still need to be
  identified: vertical half-lines at x-coordinate $-1/2$ and $1/2$ by
  horizontal translation, and the two halves of the arc of circle which
  bounds the domain below by the map $z \mapsto -1/z$. The identifications
  of these parts of the boundary of the domain can be described globally:
  they are obtained by reflection about its (vertical) symmetry axis.
We call moduli space of tori the space obtained after performing these
  identifications. Its topology is that of a sphere minus a point.
  Its geometry is richer, and is inherited from the hyperbolic metric
  on the upper half-plane. The points corresponding to $i$ and to
  $i 2 \pi / 3$ represent the square torus and the hexagonal torus,
  which respectively admit automorphisms of order 4 and 6. They are
  cone points of respective angles $\pi$ and $2\pi/3$ in the moduli
  space of tori. 
This very classical moduli space is called the modular surface or
  the modular curve, depending on whether one chooses to adopt the real
  or complex viewpoint. Because of these cone points, it is not quite
  a manifold; we call it an orbifold.

I stopped the discussion there but wish I had expanded a bit on
how Riemann found that it takes "more moduli" to describe the
geometry of closed compact Riemann surfaces of higher genus, and
concluded it took "$3g-3$ complex moduli" for genus $g > 1$.
Or if one prefers, the "modulus" of a genus $g$ closed compact
Riemann surface, for $g > 2$, is no longer a real number or a
complex number or a point in a quotient of the upper half-plane,
but a point in a $(3g-3)$-dimensional complex orbifold...
A: The word modulus (moduli in plural, cf. radius and radii, focus and foci, locus and loci) comes from Latin as a word meaning "small measure" or "unit of measure".  This is why the absolute value of a complex number z is sometimes called the modulus of z and why the word is used in physics for Young's modulus. In 1800 Gauss introduced the congruence relation $a \equiv b \bmod m$ with m being called the modulus because this equivalence relation on integers a and b was being "measured" according to the integer m. The later term "modular representation" for representations in characteristic p comes from the simplest source of fields with characteristic p being the integers mod p (and finite extensions of it).
The term modulus, from its meaning as a standard of measure, drifted into a more general usage as "parameter". This meaning led to the terms modular function and modular form by the end of the 19th century.


*

*In the study of elliptic integrals like $u(x) = \int_0^x \frac{dt}{\sqrt{(1-t^2)(1-k^2t^2)}}$ the parameter $k$ that shows up has traditionally been called the elliptic modulus of the elliptic integral. It pins down which elliptic integral you are speaking about, since the integral varies with $k$. This name for k goes back to Jacobi's work on elliptic integrals in the 1820s. Inverting the relation between u and x, $x(u)$ extends from a neighborhood of $u = 0$ to all of $\mathbf C$ as a doubly periodic meromorphic function, and if $\tau$ is a ratio of two carefully chosen periods (taken in the upper half-plane) then Gauss found a formula for k in terms of some theta-functions evaluated at $\tau$. These theta-functions are invariant under a finite-index subgroup of $\text{SL}_2(\mathbf Z)$ (specifically, invariant under $\Gamma(2)$), although such work of Gauss was unpublished until it appeared after his death (1855) in his collected works. Earlier, less than 10 years after Jacobi's work, in volume 18 (1838) of Crelle's Journal, Gudermann wrote a long paper Theorie der Modular-Functionen und der Modular-Integrale (pp. 1-54 and 220-258). Jacobi's modulus k and the Jacobi elliptic functions sn, cn, dn appear prominently in it; while I can't read this German very well, other sources that refer to this paper say Gudermann's use of "modular function" refers to what we would call elliptic functions (and, correspondingly, what he calls "modular integrals" are elliptic integrals). I mention Gudermann's paper just to point out that the term "modular function" was in use before 1840 (hence preceding Riemann's work), even if its meaning over time would change. 

*Paul Garrett says in an answer to a math stackexchange question 
here that in the 1870s Dedekind introduced in his work on algebraic number theory the term Modul for what we'd nowadays call a lattice (in Euclidean space) or finite-free $\mathbf Z$-module, and it is suggested in one of the answers here that this term might have been chosen because it was a general kind of structure you could "mod" out by. I think that is what the word eventually came to mean (related to the algebraic notion of a module), but I took a look at Dedekind's famous Chapter XI of Dirichlet and Dedekind's Vorlesungen über Zahlentheorie, where he first introduces the term Modul, in section 168, and he doesn't actually use Modul to refer to lattices at all. Dedekind is thinking of a number field as a subset of $\mathbf C$ (there were no abstract fields in those days, except for perhaps finite fields) and he defines a Modul $\mathfrak a$ as any set (he writes "System") of real and complex numbers closed under subtraction. From any elements $\alpha$ and $\beta$ in $\mathfrak a$ you get $\alpha-\alpha=0$ and then $0 - \alpha = -\alpha$ and then $\beta - (-\alpha) = \alpha+\beta$, so basically a Modul is just an additive subgroup of $\mathbf C$ (not of a general $\mathbf R^n$). Dedekind is most interested in the case when $\mathfrak a$ is a finite Modul, meaning it has a finite basis, such as $\mathbf Z + \mathbf Z\sqrt{2}$ and $\mathbf Z + 
\mathbf Z\sqrt[3]{2} + \mathbf Z\sqrt[3]{4}$ in $\mathbf R$. Neither of these are lattices, since we are not putting all the real and complex embeddings of a number field together to make such groups discrete in a larger Euclidean space. (In section 177 Dedekind defines an ideal to be a special kind of Modul in a number field.) Perhaps over time the concept of a Modul did turn into a lattice, and at least inside the integers of  imaginary quadratic fields, which are so important for complex multiplication, they are the same thing. Lattices in $\mathbf C$, up to real scaling, can be written as $\mathbf Z + \mathbf Z\tau$ with $\tau$ in the upper half-plane being determined by that lattice up to the action of $\text{SL}_2(\mathbf Z)$.  This group had been used by Gauss in the early 19th century in his work on binary quadratic forms and the arithmetic-geometric mean, but the study of this group and especially its subgroups really took off in the late 19th century in work of people like Dedekind, Fricke, and Klein. On p. 364 here Klein says the term "elliptic modular function" comes from Dedekind's 1877 article here. What about modular forms? Eisenstein series were introduced in the mid-19th century and they were viewed later as certain homogeneous functions on lattices. The word "form" is a concise term for homogeneous function (like "linear form" and "quadratic form"), so these homogeneous functions on lattices got the name "modular form".  According to this article the term "modular form" was introduced by Klein on pp. 143-144 here, and even if you don't know any German you can recognize the German for "homogeneous function" on p. 144. See also pp. 127-128. (From a different direction, in 1909 Dickson wrote a paper where he used "modular form" to mean "homogeneous polynomial over a finite field"!) 
Riemann introduced the term "moduli" (Moduln) in his 1857 paper on abelian functions (see bottom of p. 33 here) to refer to a count of $3p-3$ parameters or coordinates, which is the source of the later idea of a moduli space or parameter space for geometric objects of a common type. 
In summary, there are several sources of all this "modular" terminology: Gauss's modulus in 1800, Jacobi's elliptic modulus $k$ in the 1820s, Riemann's moduli in the 1850s, and Dedekind's module in the 1870s. I don't see how Riemann's moduli (leading to moduli spaces) is related to the development of the other mod-type terms in the 19th century.
A: This is too long to be a comment.
So according to Wikipedia, it looks like everything except (8) and possibly (1) come from the algebraic geometric notion of moduli spaces as parameter spaces of objects. This usage was apparently first introduced by Riemann.
The quotient of the upper half plane by "the modular group" (ie, $\text{SL}_2(\mathbf Z)$) is a moduli space (in the sense of (5)) for elliptic curves, hence the name "modular group". Modular forms are then just functions satisfying a transformation law w.r.t. to the modular group (or more generally a finite index subgroup of the modular group), or equivalently a section of a certain line bundle on this moduli space (in the sense of (5)). "Modular invariance" just means "invariance under the modular group" (ie, $\text{SL}_2(\mathbf Z)$), so it is also used there in the same way.
From my vague recollection of some conversations with topologists, topological modular forms are in some sense a vast generalization of the notion of a modular form. In any case the word "modular" is definitely used there in the same way as in "modular forms", and hence by transitivity, the same way as "moduli space".
The "modular" in "modular arithmetic" is almost certainly of a different nature. For one, this notion was around much earlier than Riemann. On the other hand, it is one of my favorite examples of mathematical terminology that has enriched my non-mathematical language: "Dinner will be spaghetti with meatballs, modulo the meatballs" (I swear there is a more natural everyday use of the word "modulo", but for some reason I can't come up with any good ones right now).
I have no idea what the "modular" in "modular tensor category" is.
