Performance improvements, syntax fixing and issue fixes

- Swedn has a great performance improvement to execute events only on resize events.
- Few variables were not declared as internal, but global.
- Removed one unused variable.
- Fixed issue with duplicated registration of the same media query.