As a partner in the British Empire, Scotland began the 20th century with an advanced economy and a world-beating heavy industry. But in the closing decades its sense of Britishness was in doubt and a Scottish Parliament sat in Edinburgh for the first time