Adding JSHint and fixing errors