Merge generate keys functionality in the main binary. Cleanups

Signed-off-by: Jani Monoses <jani@ubuntu.com>