Merge pull request #186 from sunyc/master

Patches from stavros
Merge pull request #187 from sunyc/master

Continuing reorganizing codebase
Merge pull request #188 from sunyc/master

Fix compiling under CYGWIN
Move heartbeat functionality into heartbeat.cc

Use STL containers for heartbeat implementation.