Refactor kubelet, standalone k8s and integration test to all use the same code.

Large re-factor, unifies stand-alone k8s, kubelet and integration testing code paths.
IMO, should be fixed by moving common functions to a third package which can be imported safely from both. At least some of these functions have nothing specifically to do with kubelet (Hostname, GetDockerEndpoint, etc) and could be moved, no?

The functions that take a Kublet as a parameter should plausibly be methods of Kubelet and not standalone functions.