The AmountFromValue function is defined twice, one of which is only used in bitcoin-tx, once.
The difference between them is that in rpc/util.cpp it throws a UniValue and the bitcoin-tx version throws a std::runtime_error. This deduplicates the code and makes it into a user-defined conversion on the Amount class which throws 'UniValue' as that was the one most used.
Tests are updated to conform to the simpler syntax.
Added a catch block in bitcoin-tx to handle possible UniValue throw there.