Remove default $db, added $db to constructor, and added jstests