Move spawn background tasks to ThreadPoolExecutor.

This PR is not complete. In cases of errors an email message should be send to the administrators of the system. I thought we had a system property to store such an email address. I will wait until Al returns to check with him if this property already exists.