(Re)Created Square, adapted code

The class Square was added (again) in order to handle directions when
checking if a new line has been completed.
All previous code has been adapted consequently.