fixing a few styling issues
Implements heart-beat to prevent stale connections
Implemented NullPersistence for non persistent mode