added keepalive support
added some tests (hope so)
Merge pull request #35 from NITEMAN/feature-keepalive

added keepalive support