Fix a bunch of early bugs

The first thing I did was move to buffer-scoped variables (b:) to window-scoped
ones (w:), because windows with the same file in it (:split with no arguments
for example) caused trouble since they shared the same match object.

I also added a window-scoped variable for tracking whether the plugin is active
or not, instead of looking for the match (which caused troubles I think; this
way is clearer too actually).

Last thing I did was change the autocmd events from buffer-related events
(BufEnter) to window-related events (WinEnter).