Improve HttpConnection::translateDocument() to use all set contexts. Make loops more clear.