Minor fixes and fixes to documentation/style

Added order_descending to database sql code.
Added a store_detailed_result string to avoid sending huge amounts of
text when optimizing the parameters over distributed computers.