Implements random AI moves and cleans up code

This commit implements a completely random AI that places moves in a
random available spot on the board. It also improves a few function
definitions, and adds an ai object to track its own piece and move.