Move half move clock formatting code into its own function

This gets everything in formatPosition working at the same level of abstraction
Refactor checkmate detection
Refactor en-passant analysis
Refactor half-move clock incrementation logic
Refactor stalemate detection
Refactor move generation for bishops, rooks and queens

These three pieces shared the exact same implementation, so it needed
refactoring into one shared bit of code.
Fix wonky alignment
Refactor king movement to use the same code as bishops, rooks and queens
Ditch empty lines at end of files