Embedded nanograting-based waveplates for polarization control in integrated photonic circuits