By the middle of the 1800s, how were most political candidates chosen?