Added drop queue command, fixed heartbeat bug

Heartbeat thread sometimes hung on exit, so I modified the thred to be
cancellable asynchronously.
I also added a way to drop all data in the queue, which hasn't been
tested much yet.
Fixed bug where router wasn't added to table
Eat stdout on curl call, more bcast checks