New cryptography code

Added simple AES encryption. The DPAPI is still there, but I removed the
SecureString stuff.
Some range checks and documentation