API for computing tangent and normal vectors to segments and trails

Opening a pull request so as to have a convenient place to discuss the code, and this feature generally, while I continue to work on it.  Please do not merge yet.