Optimization of Photonic Crystal Polarization Handling Devices Using Trust Region Algorithms