Added thread pool, some tests