Client refactor

Sets the groundwork for #11