Move is_valid_role() to the Postgres interaction package

Makes more sense in there
extract function for creating basic pg object
move role granting to the Postgres module
Verify the named template exists as a valid database
Remove more cruft

Since we're using a DB handle, we don't need to know the paths to
Postgres's command-line tools any more