Made UART polling more efficient

- refactored processcommand()
- removed old comments