celtus: Refactor a bit.

Put all prime testing and caching functionality in primeTester.