Ckeygen 6607 reloaded

Reworked the script, splitting option parsing and key mangling.

The option parsing takes care of the needing of getting of the default file from stdin.

Added testings on the parser.