Fix errors and add start/stop scripts for pg/mongo.

Add table space support in pg.