This code sucks.
Looks like Deluge uses old-style classes.
Simplified piece info updating
Plugin is functional once again