Recode inventory.contains from scratch

A manually coded method rather than trusting Bukkit.