Synthesis and utilization of functionalized polystyrene resins