Updates and cleanup to implementation.  See Main for example of how to establish connection and query the DB for a result set