Add logToConsole option

Uses window.console.log if defined to route payloads to that function,
using this.options.logFunction.