Update fsm-sticky-headers.js

Refactored the code, added resizing of the the header on resize of the window