Flesh out TableGateway and tests