update AES code to support different modes of operation, add unittests