Support Python 3 with anytop

Perform a general refactor, so as to support both Python 3 and Python 2.