Add bidding unit tests

Add unit tests for bidding along with code cleanup