console.log should handle large objects and null/undefined input

This stuff fixes two problems that I currently have with console logging:

- console.log will crash when the value being printed is null or undefined
- console.log will hang in infinite recursion when printing structures such as jquery objects

Potentially it would be nicer to print [null] vs [undefined] instead of nothing in the first scenario.