Switched Utils to use generic types instead of BigInt to improve performance
Improved isPrime by having it short circuit on the first found factor