Church of Scotland allows congregations to choose gay ministers