Initial work on supporting multiple terminal types (including libraries)