Fixed some semantic issues

- initializing directories does not wipe out old dirs.
- only append entries if not already there
- generator yields Key instances
- removing entry removes all occurrences

@ali01