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.
Always bring the definition down when it gets too long. Should be a newline and then four spaces.