Binary copy postgres

It took me much longer to get this right than I thought but here it is. The date stuff was just horrible. 

See http://www.postgresql.org/docs/9.0/static/sql-copy.html for documentation about the format.