- pagination click function moved out of the loop
- sinon etc added for tests