Use the P helper module in the implementation of Db.

Change-Id: Iaf71b0cf160ddb92a7c337c39ef09985474ebb8e