Remove use of sax parser; use ElementTree for anno header too.

Also fix some static analysis warnings.