Item lookup now works for PG

Also reworked the spagetti code for resolving the item names. It is much
simpler now, but might need some error handling.