bpo-36419: IDLE - Refactor autocompete and improve testing. (GH-15121)

(cherry picked from commit 1213123005d9f94bb5027c0a5256ea4d3e97b61d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 files changed