Initial implementation of column name mapping and PostgreSQL support for the upload tool.

Pushed up some more changes that I forgot to stage in the previous
commit!