1) cmp sort: use O(1) data, not O(N); 2) refacored to use common r/w providers implementation; 3) -c, -m options introduced to tweak behavior from command line