Issue 447

Fix a bug that fetching a new event is delayed until two or mode events are stored in Zabbix.

To add a test for it, I also simplify ZabbixAPIEmulator because the previous code was hard to
understand for me.

In addition, I also add a test for #252 because the bug was introduced by the fix for it.