Removed unnecessary code.
Changed interface of choose function to more accurately express the capabilities of the underlying algorithm
Added tests for choose function
Fixed a few bugs caught by new tests.