Add reconnection support.

Renamed pg to make a bigger distinction between postgresql
(the connector), pg (the connection library), and the individual
connection.

Signed-off-by: Samuel Reed <samuel.trace.reed@gmail.com>