Workaround a CB bug by tracking piston events

There is a bug in Craftbukkit that causes piston events to fire
multiple times. We need to keep track of the extend and retract events
to see which piston events should be processed.
Fix bugs with pistons

This commit improves piston tracking and fixes a couple of bugs with
block tracking.

Fixes #2043