Update p+1 factoring, add to tests
Combine lots of functions with common signatures
fixup AES Lucas test