Put connection function in new file.

Fix capitalization problem in DB name.