Pull out choose functionality
Rename globals -> gvars
Dedup choose code
Add debug logging
Shorten some debug messages
Make search go into choose
Add documentation
Make methods private to avoid abuse