Bug fixes, comments

Review and commented functions.js / Fix the scroll to top behavior not
based on window anymore