move gs_pagination to library.php
add gs_debug() function and improve gs_pagination()