Use logging library instead of console.log

@bcamper 
Normally people throw either instances of `Error` or a custom object. This usually allows the browser to track the stack of where the error was thrown. Any objection to throwing an error here?