Fix max for python 3

In python 2, max(None, 1) returns 1. In python 3, it's an error
because None isn't orderable. Now we use -1 instead of None.
Add edit.py from SublimeXiki
Add Edit.end
Use Edit.edit instead of View.edit
edit.py: allow setting a command name
Check command name instead of using "pending"