Polymers for use in optical devices