fix a bug where select does not act on partitioned list
refactor partition to take the element
refactor medianOfMedians to return the element, not the index (and related abstractions)
fixing bug where select 1 [1, 0] = 0