[#1626] On Windows find files with extensions before full path.

Problem description
===================

Some applications are distributed with both unix and windows commands.

For example for npm

* npm - is windows shell
* npm.bat is windows bat file


Why we got into this (5 whys)
=============================

* There was no test for this case.


Changes description
===================

Refactored the code and also updated some previous tests.

Added minimum support to pass the web tests. For now it only does the deps_web part, as this is they one with problem. test_web part is still not stable and we will move it out of server when it gets stable.


How to try and test the changes
===============================

reviewers @alibotean 

Check that everthing is ok.