Remove unused global variables
Remove unused VSHIFT variable
Remove obsolete comment
Fix default value for repchar attribute
Initialize all global variables explicitly

Also mark complicated cases as such
Merge pull request #1244 from dottedmag/cleanups/fix-globals

Cleanups/fix globals