Simplify handling of preference changes
Add debug function to write into stdout
Fix: don't use cached preferences in loadPatterns()
Regression in 24f8107a307f3251d53dc6220496e65c1aef1fd6 commit:
we should keep cache updated or don't use it at all