Fix: now able to use multiple Database instances in mt
stats uses separate Database object (separate connection) preparing the
way for transactions
logging now thread safe