Added processCharacter method

Separated buffer building and command parsing from serial port reading.