Some tidying up. Added game handling, some helper functions from BOSSv2, some globals, the API files, the beginnings of the sorting algorithm stuff and some BOSS data cache file reading/writing.