Alignment and testing of optical components