Refactor socket api terminal handler
Refactor socket api terminal handler

The 'terminal' handler code is broken out to get ready
for using 'shell' as well as 'console'

whowutwut/confluent,jjohnson42/confluent,xcat2/confluent,xcat2/confluent,whowutwut/confluent,jjohnson42/confluent,xcat2/confluent,xcat2/confluent,whowutwut/confluent,jjohnson42/confluent,xcat2/confluent,jjohnson42/confluent,jjohnson42/confluent,whowutwut/confluent