epg: move all sort routines to new one