refactor main.js
fix template with stub temporarily
remove duplicated pref.js
Merge pull request #137 from mizchi/main

Refactor main.js