Init: modularizes shared functions
Init: works out the O(n) sort
Init: tests out the first two versions of minFree