Improved thread utils.
Implemented generic and thread-oriented activity base.
Simplified worker activity implementation, based on thread activity.
Fine-grained layered activity design.
Fixed activity-based DB implementation.