Added basic Java/Java unit tests
Added heartbeat support
Improving reconnection behavior.