Move the text console logic into a separate module

Signed-off-by: David Scott <dave.scott@eu.citrix.com>