Implement test_part_registry and the test_part_registrar it uses internally.

Includes complete unit tests for test_part_registry and unit tests for
test_part_registrar that need some work after some additions to the
concurrency.

In thread.hpp move inclusion of pthread.h out of namespace and add
exception header.
Changes to main_three_threaded::run to faciliate running in a loop.