Updated DB class to expose db connections via namespace functions.