Clean up spectator code, put vars/functions in seperate files.