Don't use deprecated Cdb classes

Change-Id: I52ba659387b1d315a2c8da6dddfeea4608df94d7
Don't set a global $dir variable

Change-Id: Ia1a33df6e022967c75b559b0774dcd83546736d9
Merge "Don't use deprecated Cdb classes"
Merge "Don't set a global $dir variable"