Added new function getting sql count for query
Added new fields
Added pagination support
Added support for pagination