Renamed bet to bid, factored out some patterns in server, and added a
passing boolean in frontend/backend.