Issue 447

Fix a bug that fetching a new event is delayed until two or mode events are stored in Zabbix (issue #447).

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, and there
is no test for it.