Cleaned up the code and rearranged it, added a static variable that
allows for debugging code to be run conditionally, made the piece
movement checking modular.