make thread id and time difference logging part of quirk handling code
add 'after' parameter to hook, which says if hook called before or after function