Moved the event registrations out of the startup function due to handlers being defined after the function
Added unit id checks to all event handles so they will abort if its not the current target