Single Domain Client 69471926

Finishes https://www.pivotaltracker.com/story/show/69471926

Sorry for all the commits. This started out really complicated and got simpler as I learned how everything worked.