The Supreme Court has agreed to hear a religious liberty case that began when a shop owner refused to make a wedding cake for a gay couple.