Fixed variable is already defined in JSLint

W004: 'elem' is already defined
Fix the wrong element order
Sync minify with the main code
Element return order fix
Grunt