Cleaned up and improved the populate_nextmove management command.