ajax paging, some js cleanups