Adding a commandline test tools to verify postgresql integration code.
More changes, additions and reorganization of files wrt postgresql integration.