Refactored and extended variable resolution in opam files

The behaviour has slightly changed, but should be more powerful and the code much clearer:
- in the opam file of `pkg`, `%{variable}%` will now be understood as `%{pkg:variable}%``
- the information returned (eg. version) corresponds to the current opam file if relevant, OR to the installed version of the named package
- new package variables: name, version, depends, hash


Todo:
- fix the manual accordingly
- fix `opam config var list`. We probably don't want every var for every package there.
- extend the compilation environment to make the new variables accessible from the build scripts ? (probably not for costly ones)