improved auto-resolution for cpanm

* refactored code
* added new solutions
* added some initial tests