Minor code fixes and resize handing improved

- added missing semicolons
- removed duplicate var declarations
- when calling .off on the window it should not remove all handlers,
only the one set by the plugin