Switch from AES implementation to XOR implementation

This removes the dependency on PyCrypto and any external libararies.

Also some testing updates and improvements.