Added support for test dependencies.
Added new test (generic constraints).
Some cleanup/refactoring.