Big refactoring
fixed some bugs(directory processing, case insensitivity for path,...)
add new impl
Merge pull request #1 from bashor/master

Big refactoring and some fixes