Fixing asynchronous behavior

Moved most processing logic to within the Zotero.selectItems() callback