added .gitignore, fixed package.json and refactored