Centralizing agent creation

I packaged the temp dir and user agent into one object that can be passed to all objects that need to create clients.