Fix test cases for the Discover model
Slightly modify tests & code to make it work with PhantomJS
Allow unit test execution with Testacular

Together with PhantomJS, this makes headless execution
of the unit test suite possible. Useful for continuous
integration and test-on-save during development.
Merge branch 'testacular'