Add postgres host as data store for cloud_controller et al.  Added postgres tests.

Some minor refactoring/scripting improvements