Refactor popup.js Split the mono function into pieces.
Refactor popup.js
Split the mono function into pieces.

Review URL: http://codereview.appspot.com/4032043
linqiangl/compatibility-detector,linqiangl/compatibility-detector,linqiangl/compatibility-detector