Fix support for environment variables

Following https://github.com/michaelsauter/crane/pull/47, configs containing environment variables resulted in various errors. This fixes those errors, refactor the code to better distinguish whether values are expanded or not, and add some sanity-checks in the test to make sure dependency checks and filtering are done on expanded values.

2d1a0ee is just a test on something that wasn't broken, but I thought I could protect some more functionnality against regressions related to environment variables.

It's on top of https://github.com/michaelsauter/crane/pull/54 as I couldn't get the compilation/test steps to go through.