Refactor and insert copyrights
Update gitignore