Main parts of core converted. Encryption/decryption untested for now