Build up header_lib and re-use headers from there

Instead of re-doing identical NVPair() invocations for each request, we
now invoke NVPair() once per request and store this in the header_lib
variable. Requests use entries from this list.

Besides resulting in more compact code, the biggest advantage here is
that one can for example easily modify a session cookie in one place,
and not for each and every single request.