Contextual Bandits with Packing and Covering Constraints: A Modular Lagrangian Approach via Regression