Implement CustomEvent (#2173)

This was previously PR'd on #2218