Separated UI from core

Separated terminal UI and core functionality of Tray.