The rise and fall of the Scottish cotton industry, 1778-1914: 'The secret spring'