Add get_type function, move HeapFunctions to proper package