Spec and add preliminary support for event machine