Database Password and Close

Added bz2 compressed password storage for database and included close
statements for open files.