Better application-level key handling.
New pref to change update frequency

Fixes #2