Create heartbeats dynamically as needed - avoids the need for hardcod… …
…ing and maintaining heartbeats for profiler categories. Use consistent variable names. Use Box::into_raw and Box::from_raw instead of std::mem::transmute.