upgrade to new Deadbolt API; improve tests code