Ported simulator to libev for easy event handeling.