Properly shut down TLS streams.

Refs #6107
Implement support for the "package" keyword.

Refs #6107
Run INITIALIZE_ONCE() after static initializers.

Refs #6107
API thingie (WIP).
WIP.