Python/SublimeText 3 compatibility.

Replaces xrange with range to work i nPy 3 and Sublime Text 3. No other
obvious changes needed.

Add new functon style to match: ClassName.prototype.methodName style.