Pass in pg module, instead of requiring it.