Replaced function to resolve the local_conf options

With one that also takes the global_conf to make it possible to validate
the input data.

Also heavily refactored resolution of options and their test suites.
Introduced option substitution inside the application factory
Added support for option substitution in buildout recipe