Cleanup 40-49.
- Comment 41 and 43.
- Split parsing and calculating in 42.
- Return first result in 45.
- Speed up 46 by using faster isSquare test.
- Speed up 47 by not testing primes.
- Replace naive isPrimeSimple with faster library function.
Only import necessary functions when importing modules.
Trivial comments.