Update setup and build scripts/configurations.
Fix some old django and py3 compat issues.