Firm Level Economics: Markets and Allocations