Piece positioning

There are still a few bugs and some unimplemented features. Though, it would be better to merge what has been done until now, for branches "master" and "piece-positioning" not to diverge.