Initial postgres support

Thoroughly tested (not to say I didn't miss anything, but I did put a ton of work in over the last couple of weeks to try and avoid it).