This contains some follow up items from #13033.
The PR refactors the GetTransaction function and moves it from validation to rpc/rawtransaction. This breaks a cyclic dependency between validation and index/txindex pointed out by @sipa. Also, the REST transaction API and gettxoutproof RPC now have more clear error messages when the txindex is not available, as requested by @TheBlueMatt.
This would also be a good opportunity to drop the slow tx lookup through the unspent coins view if people are for it, as proposed in #3220.