Implement the multi-threading functionality

Using Boost ASIO to implement the multi-threading part.