Added some threading infrastructure.