[fix bug 1048307] Add JS tests for mozilla-pager.js

Added a base suite of functional JS tests for `mozilla-pager.js`. This doesn't cover absolutely everything, but I think it should cover all the main functionality in terms of configurable options. I didn't want to go *too far* with the tests, but this at least ensures all the correct things are called when they should be.

Would appreciate some r from @jpetto? Also any further tests or suggestions are most welcome. I also found and fixed a minor edge-case bug while putting these together :smile:  
Nice catch sir!