Added watchdog() calls and checked to see if drush_log() function exists.

Also removed drupal_flush_all_caches(). I think this is unnecessary and I noticed issues when enabling the module thru the gui. It looks like there's an unrelated error coming from the views module when clearing the cache. I'm not sure of the problem exactly.