remove console.debug statements and do some jslint