Migrate Procedural into Client

Again, no need to hide the complexity by putting it into another class/module.
The Client class is supposed to have a lot of methods on it, they should exist
in the class itself.