updates to router.py to enable deferToThread() functionality, testing.