Updated calls to notifyChange to include eventType

I think the changes below will fix issue #117. I'm not sure what sort of testing you have in place, but this seems to work for me.

There are a bunch of minor formatting changes below - sorry, my text editor is set to clear blanks from the ends of lines.