update compile script to work with new buildpack-env-dir API

- Borrowed env-dir function from [devcenter draft](https://devcenter.heroku.com/articles/buildpack-api-staging?preview=1#summary)
- Updated [anvil tests](https://github.com/heroku/heroku-buildpack-nodejs/blob/9e1e554b60f62a0b4765150a96ca85f92ff54ee5/bin/test#L114-127).
- Smoke tested an app with and without the `buildpack-env-arg` labs flag, using an npm `preinstall` hook to dump `env` to stdout.

Ready to ship..