Sublime Text 3 support for the latest revision

I've tried to keep changes minimal. The biggest the changes are for:
- imports routines from sublime 2 to 3
- using `__file__` instead of the empty `sublime.package_path()` at module initialization
- stricter versions of `begin_edit()` and `end_edit()` from the porting guide.

Tested on sublime text 3 build 3059 and sublime text 2.0.2 build 2221, and everything appears to work.
I really needed the yaml functionality this package provides so I've tried my best to port it, hope this can be merged :)