Extract AAE test into its own module

Move the AAE test out of essential and into its own module.  This
allows a more focused and faster running test and simplifies the
essential test as well.

Change `random_keys` to prevent returning 0 keys.