Refactor to support Python 2 or 3; remove analysis.