Added tests.

Added the tests and be able then safely to refactory factorial function
(moved irange into the separate ns, and test the factorial sets).