Make sure the code which decides when to send a heartbeat copes with BST changes. Closes #45
Tidy imports