BC break: moved generation into new FileKey class and changed key generation pattern. Some cleanup altogether.