Sublime Text 3 / Python 3 fix

Should make it work both in Sublime Text 3 and Sublime Text 2.
Clean up @michfield's ST3 compatibility changes