Add events support

Draft idea for how other plugins can acquire/release a lock.