Resort records into ranked results order

Added test to ensure records returned in results order

Indentation
Merge pull request #25 from mmmmmrob/ranked_results_order

Ranked results order