Created a helper function in the tests to create spies for plugin events
Changed the name of a variable timeout -> _timeoutId to clarify what it is and to avoid naming collisions
Put the properties (plugin settings) before the methods (it makes more sense this way)