Minor fixes to logging

Use own function for logging instead of going directly to console.log.

Use safer check for console availability.

Make first check for determining logging the debug variable. This should short curcuit the statement even before checking for console availability which may be problematic for older browsers where debugging is not normally enabled.
Merge pull request #1 from kasperg/patch-1

Minor fixes to logging
The pathname doesn't contain query params and hashes.
Using URI query and fragment/hash should be an option.
Merge pull request #4 from troelslenda/master

Minor updates