Minor changes.

Fixed a way to specify WorkingDir from caller.
Changed database writer to use parametrized queries.
Database logging is soooo slow by the way. File logging is much more
preferable.