modified logtrail.js

* corrected a couple of nasty bugs
* added separate log functions for each logtype
* added Logtrail class to module.exports