RANK: Adopt a new ranking implementation.
Before this commit, the implementation of RANK made multiple passes
through the active file, opening and closing it (with proc_open()
and proc_commit()) as many times as there were input variables.
This worked in simple cases, but it could never work with
TEMPORARY since the second proc_open() will see a different set
of data from the first one.
This commit rewrites RANK to open and read the active file only
once. It does not make RANK properly work with TEMPORARY, but
it brings it much closer. It may also be faster in some cases
because, although it makes the same number of passes through
the input data (necessarily), each pass discards all the input
columns except the ones that are really need for that pass.