Algorithm efficiency increase

Increased efficiency of algorithms by:
-setting the alphabet as a list (rather than string)
-pre-setting alphabet length
-using divmod to unify dividing and modulus

timeit shows a noticeable increase