Now works with latest versions of deps

* get rid of some basic syntax errors as identified by jshint
* ensures that the log db exists before trying to write to it

I can't get the tests to work before or after these changes, but I can confirm that the plugin works now.