Support user-supplied ThreadFactories

This fixes #78