Adding 'use strict' to JS files

I also separated `var` 's in some places.