Misc refactorings + unit tests for BidService.