Add 'tidy' make target to tidy code and used it to tidy code.

This uses indent and some followup sed scripts to tidy up userdefined
types. Unfortunately indent can't identify userdefined types without
specifying them with -T, which is impractical. Instead we use sed
regexes and identify types as anything starting with 'ev_' (as used by
libev) or ending with '_t' (as used by asn1c and many others).

Renamed existing *_data types to *_data_t to match existing type
naming conventions.
Use the libev 4.x API and tidy the import order a bit.

The 3.X API doesn't have an av_loop type, which our "tidy" make target
assumes does exist and removes the 'struct'.