1. refactor main.js; 2. add test URLs in test/test-main.js; 3. add .gitignore
convert tabs to spaces