functional EventLoop class. Passes existing unit tests from ZLoop.