Fix for Database::_sort (#986). Will not output ORDER BY clause if given field is empty (ie. if  = array()).
Updated a test case.