Major refactor to make it compatible with ST3

Made it compatible with Sublime Text 3 (Python 3). It should work now in ST2 and ST3.

The refactor also separates the logic from the plugin extension points to make the implementation cleaner.

It will automatically reload settings for any open files in the editor if the `.sublime-settings` file is edited in Sublime itself.