Refactor NioMessageServiceHandler such that it is shared by TCP/SSL
transport.

Batch operations now also work with SSL transport.