Cleanup: remove unused set() function
(#18)
Improve performance: cache value of "debug" preference
(related to #18)
Simplify _log(): direct call is faster than .apply()
(and now we use only one argument)