AVR GCC LCD library allows connecting pins in any order

Optimization? Look to fmalpartida's NewLiquidCrystal.

https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

8 bit, 4 bit, I2C, ShiftOut and even a mode with one pin. And three times faster than the original LiquidCrystal library.