Also includes a decent amount of refactoring to bring it in line with Showdown code standards. --------- Co-authored-by: Slayer95 <ivojulca@hotmail.com>