added PrimeGenerator class and unit test

moved the actual prime generation code to a class and added a unit test
for it