Use /dev/dtyXX instead of /dev/ttyXX, and other cleanups.Heavily inspired by PR 12749 from Scott Telford.