Added variable-export functionality.

Experimental.
Requires YAML extension.