BUGFIX: Comparison of array address instead of first array element value.
Various refactoring changes. Switched to smaller priority array structure.
Merge branch 'simpler'
Added hook_at_thread_term() hook.
Hook hook_at_thread_term configuration option.