create build env for both dokku and new style buildpacks

This functionally works in that we get both a useful `/app/.env` and per-variable file in `/tmp/env`

ref: #787