Allocates scripts from html into separate files