Added strict mode and made code JSHint compliant