Remove TerminalWidget usage in TerminalEmulation

Instead the connection between TerminalEmulation and TerminalWidget is
done using signal/slots.

This also makes the added unit test possible.