add proper events and make the notifier class generic

Expand the event system to have explicit Event objects and potentially
many Notifiers. Previously they was only one notifier and one (implied)
event.

A lot of this is stolen from #358.
move nerdtree#treeExists.* methods into the NERDTree class
add refreshDirFlags method to avoid refreshing too many files
Merge pull request #359 from Xuyuanp/up/master

add refreshDirFlags method to avoid refreshing too many files