RandomEvent Refactor

The way certain events are handled was redone, so that instead of
calculating randomness upon the execution of a random event, it handles
the randomness before the event is pushed to the array of events to be
executed.
Also fixed tests.js to make sure the patenting test still succeeds.