WIP: did big cleanup on the new script, should be good now. Still should check for those now-unused classes in the elements