Turn Heap into template class

This helps to make sure that the GCs are always compiled completely, which avoids bitrot in conditionally compiled code.

Signed-off-by: Stefan Marr <git@stefan-marr.de>