Better way to test window.console exists