Better rank.py output #tested

Many modifications to improve rank.py output, by utilizing metadata
throughout the process of handling doc files, model files, and final
result output file.

Due to sorting of files along the way, an *_#.doc file does not always
match a *_model file. Now, the model file saves data on the origin doc
file, and the doc file on the original link. These files are shown in
the result output for a query.

By using this output, the rankings can be verified. A quick grep of the
top ranked files for the query terms confirmed the ranking to be
accurate.

TODO: Use metadata to fetch origin doc and generate summary for top
ranked result.
TODO: Evaluate rankings by some measure, say a relative PR measure to
the top result. That is if avg prob across results are low, eval is low.