Fix for JENKINS-23152

Bulk of the fix is to move the event listener part out of the trigger and only reference the job by name and do a lookup of the job instance by name when needed.
This should let old instances of the jobs and triggers to be removed correctly and not have any duplicates cause trouble.
I prefer to move ItemReference related things to core. Because all plugins which includes trigger feature might have similar issue...