Added DBConnection singleton class

This class represents a single DB connection.
Reduced code duplication by using DBConnection object.