Understanding and Controlling Behavior of Polymers in Porous Media