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