Split up some of the code in retroarch.c to general.c