Refactored the TLS use of the new runtime

Merged with task killing code this time around.