The British Development of the Theory of Invariants (1841–1895)