Rewrote dependency solver

Tests in pull request #57 shown that previous version of dependency didn't work. This pull request fixes that.

API for dependency solver invocation changed a little, that's why there's a bit of code changed in tests.