Evdev

Merge in idunham's white space and ifdef cleanups, and sync with dimkr's branch in preparation for adding evdev support.