Update decode.py

The correct and final version based on the API for ST3. 

Remove end_edit and begin_edit. Final Pull Request. Sorry for the multiple requests. Just getting the hang of Forking and Pull requests, can't seem to edit the code of the previous pull requests.