Refactoring gyp file
Add a test and fix it.