Convert apply() to function call syntax, inspired using “2to3”

* Calls with variable argument lists available since Python 2.0
* No need to manually unpack iterators before the call
Remove references to long() type, inspired using “2to3”

* L suffix not needed since Python 2.2; dropped from Python 3
Clean up oldskool Python syntaxes

* != over <> for not equal
* Octal literals may use “0o” prefix since Python 2.6 and must in Python 3

Inspired using “2to3”.
Use os.getenv() rather than rolling ones own