adding .gitignore, moving functions to a main.js file and changing member functions to prototypes