add function for detecting if we running on the linux virtual console
determine if we are in the virtual console prior to setting locale
some reorganizing