Support for third argument in retrieveRecord

The third argument in retrieveRecord can be used for adding more
retrieval conditions like ORDER BY, GROUP BY, HAVING etc. However, note
that the conditions in this third argument do not include the WHERE
conditions. They still need to be given in the 2nd argument. Also, not
that the conditions in the third arguments must be in the proper order
allowed by mySQL. For eg. a group by followed by order by isn't allowed
in mySQL and therefore it would generate an exception.