xfeed stability and cleanup

Set page and total to the correct numbers with proper fallbacks
Cleaned up SQL and options