Fixed JSHint and deprecation errors, added use strict