Add support for thread-local definitions.