Refactor Threadpool class

Part of #4 issue.
Done. However, I'll leave "Lock" typedef in both ThreadPool and Latch for now, because these files do not include any common header. It's unnecessary for now.