Moved UART functions to external library