added config.js
added exports to database.js
changed rowcount to rows.length for fewer errors.
database access is error prone.