Lay some groundwork and add preferences window