Replace chained gets with getPiece.

This uses my new getter function instead of manually accessing the
board. It's easier to use and looks cleaner.
Replace code with min & max methods.

The java standard library provides min and max functions. I should use
them instead of doing this manually. It's a lot clearer.