Replaced mockery with rewire

Tests still pass.