allow to specify dump directory by environment

I wrote this a while back and actually don't even use it anymore. But it works and may be handy for somebody else.