Tuple expressions for sql lib

Creates tuple expressions, to enable paging on multiple-column indexes.