Add an adaptation of Tsuru's client and some refactorings.