Added jslint checking and fixed warnings.