Refactoring and cleanup

Get rid of dead code.
Cleanup LCD message processing.