Solves Problem 10 and improves primality.rb.  Problem 10 is still exceeding alloted runtime.