Refactor HD44780 controller implementation