Moved most globals into struct.