Refactor js code
Improve adaptive layout
Fix auto restart bug
Merge branch 'master' into gh-pages