Ligth modification to popup.js

Reordering functions.

Signed-off-by: Braiam Peguero <braiamp@gmail.com>