Implement CustomEvent (#2173)
auto merge of #2374 : Manishearth/servo/customevent, r=jdm

This was previously PR'd on #2218