In the midst of #5387, this patch transforms the trade dialog and selection barter panel code to use class syntax.
As for the other patches, the purpose is to remove global procedures and functions, to group code to increase stronger relationships between the functions and states of an individual component and to make the different components agnostic of each other,
as such making it more extensible for future authors and modders.
As a minor change, this introduces new translated strings, thus making the code slightly slower.