General fixes on board piece logic

This commit represents a lot of work on the Piece model; lots of generalizable
piece logic has been moved onto Piece, tests have been written for existing
functionality, and lots of existing but broken functionality has been fixed.