factored client window into its own class, added preferences class