Added automatic separation of read / write connections into database layer.