Refactor client and config into own packages