[Optimization]  Replaces some str.endswith/starswith.

When we know the size of the string, splicing is always
executed much faster than these methods.

>>> from timeit import timeit
>>> timeit("'abcdefg'.startswith('abcd')")
0.22671103477478027
>>> timeit("'abcdefg'.startswith('accd')")
0.19584298133850098
>>> timeit("'abcdefg'[:4] == 'abcd'")
0.09667706489562988
>>> timeit("'abcdefg'[:4] == 'accd'")
0.0835261344909668
[Cleanup]  Removes hundreds of useless "else" statements.
[Optimization]  'value == None' to 'value is None'.

'==' is trying to do a full comparison, while 'is' only checks
if value is the same object as None.  A common optimization.

>>> from timeit import timeit
>>> timeit("'a' == None")
0.0769491195678711
>>> timeit("'a' is None")
0.03881406784057617
[Optimization]  'value != None' to 'value is not None'.

>>> from timeit import timeit
>>> timeit("'a' != None")
0.0746760368347168
>>> timeit("'a' is not None")
0.036453962326049805
[Optimization]  'for i in [a, b, c]:' to 'for i in (a, b, c):'.
[Code cleanup] 'i = i + 1' to 'i += 1'.
[Code cleanup] Removes duplicate dict key.
[Code cleanup] Removes redundant parenthesis.
[Code cleanup] Removes trailing semicolons.
[Code cleanup] Removes unnecessary backslashes.