Various AVR updates and improvements.

See the commit notes for each individual commit.