Add basic event functions and tests