better debug logging, connect() now accepts , improved database()