restructured makefile so the default rule rebuilds the TODO file.
include 'TODO' items in TODO.txt.
Rebuilt the TODO list.
refactor of paginated fetching to address the bug with paginating complex queries and to allow CALC_FOUND_ROWS mode.
lots of tests to check it works
support for passing `count_fields` for complex paginated select queries