Define the console functions as empty functions if they are undefined

This enables the code to run on IE and WP7.