Plugin will look for package.json after not finding bower.json

Did some refactoring. Added tests and new test fixutres.