Fixes jQuery references and prevents errors from log browsers without console functionality 

Both '$' and jQuery were used as references to the jQuery class. I switched them all over to jQuery. 

Logging is done using the console.log function. I have added a check to ensure console exists before trying to log.