Library for arbitrary query pagination and view generation