Record extra information as environment variables

For now we are adding last exit code and jobs count.

We need to pass these from the shell instance, because they're not
available outside it.
Merge pull request #64 from nb/pass-extra-env-information

Record extra information as environment variables