ported trap functions to tripoints

A very simply straight forward translation to tripoints. Will certainly need more work on it.
port some assorted functions to use tripoints