Restructure serial parsing code

Use a little state machine to make
the code more readable and also improve
error feedback to the user.

Also protects the internal buffers from
overflowing when the user input is too large.
Rename bluetooth module to serial_command

It's a much better fitting name now.