Implement Eventloop based on pecl/ev

Fix #160

The tests are failing for now, but the bug (ev does not seem to work with php://temp) was reported.