King Charles III backed research into the UK monarchy's ties to slavery after a document revealed that his ancestor had shares in a slave-trading company.