Reduce default RAM usage

- Reduce max number of topics.
- Reduce packet storage size in the network socket.
Implement keep alive timer and disconnect discovery
Add retry on network layer