Added better threading support

Each event now runs in its own thread