Added gen-key and logging

This commit enables logging and adds the gen-key program to generate
keys.