Pagination pages

Tweak pageRange code to better handle loading data. (when totalPages is undefined)

Also drop extra setRange() call, angular will always fire every watch once.