Make overloading of temp and final ids uniform

introduce two simple type classes to ensure that operations that take temp and final ids accept all variants of them