Thousands of documents and messages have been released relating to the prime minister's decision to appoint Peter Mandelson as ambassador to the US.