Gather functions to work with result in dedicated trait

Gather functions `apply`, `fold`, `foldWhile` and `withIterator`, using by both `Sql` trait and `SqlQueryResult`, in a common dedicated trait `WithResult`.