Moved keygen into lib/.
Tabs v spaces etc. As per regulations, the offender was shot.