Refactoring and add config file
Add support for phantomjs and travis CI