Using boost::wait_for_all() to wait for maid & pmid and more work on pmid registration.