Overhaul

No longer is len(alphabet) needed in any of the base functions. Switched
to the Baillie-PSW primality test for better speed and performance.