Crystals and analytical engines: Historical and conceptual preliminaries to a new theory of machines