Major clean up. No Python 3 support yet.