Fixed up main a little more

Main now calls Tables.closeConnection() rather than closing connection
itself.