Added tipid<=>int conversion functions

tipid_to_int() and tipid_from_int()