Infinite scroll in modal popups

I made the infinite scroll plugin more generic which can be rendered in popups and is more useful when data is fetched using ajax requests.