reworked trait storage, moved scripts to swfscripts.c