More general cleanup; remove Python 2 support

This pull request fixes more compiler warnings, removes Python 2 support, fixes Emacs indentation support, and includes some renaming to work around linking problems introduced by #1254 on some platforms.