Internal: Refactor copy headers mechanism in REST API

The functionality of copying headers in the REST layer (from REST requests to transport requests) remains the same. Made it a bit nicer by introducing a ClientFactory component that is a singleton and allows to register useful headers without requiring static methods.

Plugins just have to inject the ClientFactory now, and call its `addUsefulHeaders` method that is not static anymore.

Relates to #6513
Why not? Just note that this name was previously introduced, but we can still change it since it's  part of 1.4 which hasn't been released yet.