Fix trigops

Certain operations, for example ```abs(f)``` where ```f``` is a ```trigfun``` can only be done if the function ```f``` first converted to a ```chebtech``` based object. This branch is an attempt to take care of such castings.

This also deals with #1271 , hence I am closing pull request #1271 without merging.